
import qs from "qs";
import request from "@/js/util/request";
export const UserLoginService = (LoginData) => {
    var username = LoginData.username;
    var password = LoginData.password;
    var url = "/login?username=" + username + "&&password=" + password;
    let result = request.get(url)
    return result;
}
export const UserRegisterService = (registerData) =>{
    //Post的要求格式是application/x-www-form-urlencoded，即：数据存储在URL中，用&连接
    //使用URLSearchParams可以将数据转化成上面的格式
    //或者用qs.stringify()
    //后端不能直接用user实体类来接了，必须用参数username,password，因为多了个个rePassword
    const params = qs.stringify(registerData);
    let result = request.post("/register", params);
    return result;

}